package com.yonghui.sandbox.controller;

import com.yonghui.sandbox.common.ResponseResultVO;
import com.yonghui.sandbox.service.LoginUserService;
import com.yonghui.sandbox.vo.LoginParamVO;
import com.yonghui.sandbox.vo.LoginResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 登录
 * @author: zhangtong
 * @create: 2021-03-15 11:42
 **/
@RestController
@RequestMapping("/login")
public class LoginController {

    @Autowired
    private LoginUserService loginUserService;

    @RequestMapping(value = "/login")
    public ResponseResultVO login(LoginParamVO loginParamVO){
        LoginResultVO loginUserInfo = loginUserService.getLoginUserInfo(loginParamVO);
        return ResponseResultVO.success(loginUserInfo);
    }

    @RequestMapping(value = "/thirdLogin")
    public ResponseResultVO thirdLogin(LoginParamVO loginParamVO){
        LoginResultVO thirdLoginInfo = loginUserService.getThirdLoginInfo(loginParamVO);
        return ResponseResultVO.success(thirdLoginInfo);
    }


}
